﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="lock.aspx.cs" Inherits="Carroit.Web.admin._lock" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>


<!DOCTYPE html>

<%="<!--[if IE 8]> <html class=\"ie8 no-js\"> <![endif]-->"%>
<%="<!--[if IE 9]> <html class=\"ie9 no-js\"> <![endif]-->"%>
<%="<!--[if !IE]><!-->"%>
<html>
<%="<!--<![endif]-->"%>
    <!-- BEGIN HEAD -->

    <head>
        <meta charset="utf-8" />
        <title>管理员锁定 - <%=Evan.Common.CommFun.GetAppSetting("AdminTitle") %></title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta content="width=device-width, initial-scale=1" name="viewport" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <meta name="renderer" content="webkit" />

        <!-- BEGIN GLOBAL MANDATORY STYLES -->
        <link href="assets/global/css/css.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
        <!-- END GLOBAL MANDATORY STYLES -->
        <!-- BEGIN PAGE LEVEL PLUGINS -->
        <link href="assets/global/plugins/bootstrap-daterangepicker/daterangepicker.min.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/morris/morris.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/fullcalendar/fullcalendar.min.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/jqvmap/jqvmap/jqvmap.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/jstree/dist/themes/default/style.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.css" rel="stylesheet" type="text/css" />

        <link href="assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css" rel="stylesheet" type="text/css" />

        <!-- END PAGE LEVEL PLUGINS -->
        <!-- BEGIN THEME GLOBAL STYLES -->
        <link href="assets/global/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
        <link href="assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
        <!-- END THEME GLOBAL STYLES -->
        <!-- BEGIN THEME LAYOUT STYLES -->
        <link href="assets/layouts/layout/css/layout.min.css" rel="stylesheet" type="text/css" />
        <link href="assets/layouts/layout/css/themes/darkblue.css" rel="stylesheet" type="text/css" id="style_color" />
        <link href="assets/layouts/layout/css/custom.min.css" rel="stylesheet" type="text/css" />
        <!-- END THEME LAYOUT STYLES -->
        <link href="assets/pages/css/login.css" rel="stylesheet" type="text/css" />
        <link href="assets/pages/css/lock.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/bootstrap-toastr/toastr.min.css" rel="stylesheet" type="text/css">
        <link href="assets/custom/css/custom.css" rel="stylesheet" type="text/css" />

        <link rel="shortcut icon" href="/favicon.ico" />


</head>
    <!-- END HEAD -->

    <body class="">
        <div class="page-lock">
            <div class="page-logo"><img src="assets/pages/img/logo.png" alt="logo" style="max-width:150px;"  /></div>
            <div class="page-body">
                <div class="lock-head"> 管理员锁定 </div>
                <div class="lock-body">
                    
                    <div class="lock-form" style="text-align:center;padding-left:0px;">
                        <h4><%=Evan.Member.Administrator.GetAdminName() %></h4>
                        <div class="form-group">
                            <input class="form-control placeholder-no-fix" type="password" id="password" autocomplete="off" placeholder="请输入登录密码解锁" name="password"  style="margin:0  auto;"/> </div>
                        <div class="form-actions">
                            <button type="button" class="btn red uppercase" id="btn_login" data-loading-text="解锁中...">解锁</button>
                        </div>
                    </div>
                </div>
                <div class="lock-bottom">
                    <a href="login.aspx?action=loginout">安全退出</a>
                </div>
            </div>
            <div class="page-footer-custom">2013-<%=DateTime.Now.Year %> © 沙漠风 </div>
        </div>
        <!--[if lt IE 9]>
<script src="assets/global/plugins/respond.min.js"></script>
<script src="assets/global/plugins/excanvas.min.js"></script> 
<![endif]-->
        <!-- BEGIN CORE PLUGINS -->
        <script src="assets/global/plugins/jquery.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
        <!-- END CORE PLUGINS -->
        <!-- BEGIN THEME GLOBAL SCRIPTS -->
        <script src="assets/global/scripts/app.min.js" type="text/javascript"></script>
        <!-- END THEME GLOBAL SCRIPTS -->
        <!-- BEGIN PAGE LEVEL SCRIPTS -->
        <script src="assets/pages/scripts/lock.min.js" type="text/javascript"></script>
        <!-- END PAGE LEVEL SCRIPTS -->
        <!-- BEGIN THEME LAYOUT SCRIPTS -->
        <!-- END THEME LAYOUT SCRIPTS -->
        


        <!--[if lt IE 9]>
        <script src="assets/global/plugins/respond.min.js"></script>
        <script src="assets/global/plugins/excanvas.min.js"></script> 
        <![endif]-->
        <!-- BEGIN CORE PLUGINS -->
        <script src="assets/global/plugins/jquery.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
        <!-- END CORE PLUGINS -->
        <!-- BEGIN PAGE LEVEL PLUGINS -->
        <script src="assets/global/plugins/moment.min.js" type="text/javascript"></script>

        <script src="assets/global/plugins/morris/morris.js" type="text/javascript"></script>
        <script src="assets/global/plugins/morris/raphael-min.js" type="text/javascript"></script>

        <script src="assets/global/plugins/counterup/jquery.waypoints.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/counterup/jquery.counterup.min.js" type="text/javascript"></script>

        <!-- 
        <script src="assets/global/plugins/amcharts/amcharts/amcharts.js" type="text/javascript"></script>
        <script src="assets/global/plugins/amcharts/amcharts/serial.js" type="text/javascript"></script>
        <script src="assets/global/plugins/amcharts/amcharts/pie.js" type="text/javascript"></script>
        <script src="assets/global/plugins/amcharts/amcharts/radar.js" type="text/javascript"></script>
        <script src="assets/global/plugins/amcharts/amcharts/themes/light.js" type="text/javascript"></script>
        <script src="assets/global/plugins/amcharts/amcharts/themes/patterns.js" type="text/javascript"></script>
        <script src="assets/global/plugins/amcharts/amcharts/themes/chalk.js" type="text/javascript"></script>
        <script src="assets/global/plugins/amcharts/ammap/ammap.js" type="text/javascript"></script>
        <script src="assets/global/plugins/amcharts/ammap/maps/js/worldLow.js" type="text/javascript"></script>
        <script src="assets/global/plugins/amcharts/amstockcharts/amstock.js" type="text/javascript"></script>
        -->

        <script src="assets/global/plugins/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/horizontal-timeline/horozontal-timeline.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/flot/jquery.flot.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/flot/jquery.flot.resize.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/flot/jquery.flot.categories.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/jquery-easypiechart/jquery.easypiechart.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/jquery.sparkline.min.js" type="text/javascript"></script>


        <script src="assets/global/plugins/select2/js/select2.full.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootstrap-maxlength/bootstrap-maxlength.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootstrap-contextmenu/bootstrap-contextmenu.js" type="text/javascript"></script>


        <!-- END PAGE LEVEL PLUGINS -->

        <!-- BEGIN THEME GLOBAL SCRIPTS -->
        <script src="assets/global/scripts/app.js" type="text/javascript"></script>
        <!-- END THEME GLOBAL SCRIPTS -->

        <!-- BEGIN PAGE LEVEL SCRIPTS -->
        <script src="assets/pages/scripts/dashboard.js" type="text/javascript"></script>
        <script src="assets/pages/scripts/components-select2.js" type="text/javascript"></script>
        <script src="assets/pages/scripts/components-bootstrap-maxlength.min.js" type="text/javascript"></script>

        <script src="assets/pages/scripts/ui-blockui.min.js" type="text/javascript"></script>


        <script src="assets/pages/scripts/components-context-menu.js" type="text/javascript"></script>


        <!-- END PAGE LEVEL SCRIPTS -->



        <!-- BEGIN THEME LAYOUT SCRIPTS -->
        <script src="assets/layouts/layout/scripts/layout.js" type="text/javascript"></script>
        <script src="assets/layouts/layout/scripts/demo.min.js" type="text/javascript"></script>
        <script src="assets/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>
        <!-- END THEME LAYOUT SCRIPTS -->


        <script src="assets/global/plugins/bootstrap-toastr/toastr.min.js" type="text/javascript"></script>
        <script src="assets/pages/scripts/ui-toastr.min.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootbox/bootbox.min.js" type="text/javascript"></script>


        <script type="text/javascript" src="assets/global/plugins/RSAEncrypt/RSAEncrypt.min.js"></script>
        <script type="text/javascript">
            var publickey = "<%=new Evan.Encrypt.RSAEncrypt().PublicKeyModulus%>";
            var rsa = new RSAEncrypt(publickey);
        </script>

        <!-- 多图拖拽 -->
        <script src="assets/global/plugins/drag-arrange.js" type="text/javascript"></script>

        <!-- 编辑器配置文件 -->
        <script type="text/javascript" src="assets/ueditor/ueditor.config.js"></script>
        <!-- 编辑器源码文件 -->
        <script type="text/javascript" src="assets/ueditor/ueditor.all.js"></script>

        <!--分页-->
        <script type="text/javascript" src="assets/layui/laypage/laypage.js"></script>

        <!-- 自己的插件Start -->
        <script src="assets/custom/js/carroitplug.js" type="text/javascript"></script>
        <script src="assets/custom/js/verify.js" type="text/javascript"></script>
        <script src="assets/custom/js/upload.js" type="text/javascript"></script>
        <!-- 自己的插件End -->

        <script src="assets/custom/js/custom.js" type="text/javascript"></script>
        <script src="assets/custom/js/app.js" type="text/javascript"></script>


        <script type="text/javascript">
            var csrf_token = "<%=Evan.Common.CommFun.TokenGenerate(false)%>";
            
            $(function () {


                $("input").keydown(function (event) {
                    event = document.all ? window.event : event;
                    if ((event.keyCode || event.which) == 13) {
                        $("#btn_login").click();
                    }
                });

                var adminlogin_flag = false;
                $("#btn_login").on("click", function () {
                    if (adminlogin_flag) {
                        return false;
                    }
                    var password = $("#password").val();
                    if (password == "") {
                        notice("请填写您的管理密码用于解锁", "warning");
                        return false;
                    }

                    password = rsa.Encrypt(password);
                    $('#btn_login').button('loading');

                    var a = { pwd: password, token: csrf_token };
                    adminlogin_flag = true;
                    AjaxSubmit(appConfig.adminPath + "ashx/administrator.ashx", "adminUnLock", a, function (flag, data) {
                        if (flag) {
                            if (parseInt(data.result) == 1) {
                                $('#btn_login').text("解锁成功 , 正在跳转...");
                                var from_url = QueryString.GetValue("from");
                                if (from_url != "" && from_url !== undefined) {
                                    window.location.href = decodeURIComponent(from_url);
                                }
                                else {
                                    window.location.href = appConfig.adminPath + "index.aspx";
                                }
                            }
                            else if (parseInt(data.result) == 2) {
                                notice(data.returnval, "notice");
                                setTimeout(function () {
                                    window.location.href = "login.aspx";
                                }, 2000);
                            }
                            else {
                                adminlogin_flag = false;
                                $('#btn_login').button('reset');
                                notice(data.returnval, "error");
                            }
                        }
                        else {
                            adminlogin_flag = false;
                            $('#btn_login').button('reset');
                            notice("解锁出错 , 请稍后再试", "error");
                        }
                        //console.log(flag, data);
                    });
                });
              
            });

        </script>

    </body>

</html>
